<?php
/**
 * 动态消息记录
 * @return
 * @author yuncran@126.com
 */

namespace app\model;

use app\BaseModel;
use app\CacheKey;

class TrendsMagModel extends BaseModel
{
    protected $name = 'trends_mag';

    protected $pk = "id";
    protected $jsonAssoc = true;

    protected $append = [
        'trends',
    ];


    public function getTrendsAttr($value,$data)
    {
        return TrendsModel::where('id',$data['trends_ids'])->field('id,user_id,title,content,create_time')->cache(true,CacheKey::common)->find();
    }
}